package com.tom.spring.demo.service.impl;

import com.tom.spring.demo.service.UserService;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author : tom
 * @project: tom-spring
 * @date : 2018/9/25 17:03
 */
public class UserServiceImpl implements UserService {
    @Override
    public Object get() {
        System.out.println("========getUser=========");
        return "User";
    }

    @Override
    public String query(String name) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = sdf.format(new Date());
        String json = "{name:\"" + name + "\",time:\"" + time + "\"}";
        return json;
    }
}
